﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/meta.tpl"-}
<title>订单报告 - 后台</title>
</head>

<body>
<div class="sAll">

{-include file="`$__PHY_WEB``$__DIR_ADM`/block/header.tpl"-}
{-php-}include(__PHY_WEB.__DIR_ADM."/block/menu.php");{-/php-}
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/menu.tpl" uL=$rNav-}

<div class="sL right">
	<div class="main">
<!-- <main> -->
{- if $sMsg -}{- include file="`$__PHY_WEB``$__DIR_ADM`/block/message.tpl" -}{- /if -}

{- if 'list'==$sAction -}
<div class="sL list">
	<p>订单列表：</p>
	<table>
		<tr>
			<td colspan="7">
				{-if 'all'==$rP.status-}<span>全部</span>{-else-}
				<a href="?status=all">全部</a>{-/if-}
				{-if 'unpaid'==$rP.status-}<span>未付款</span>{-else-}
				<a href="?status=unpaid">未付款</a>{-/if-}
				{-if 'canceled'==$rP.status-}<span>已取消</span>{-else-}
				<a href="?status=canceled">已取消</a>{-/if-}
				{-if 'paid'==$rP.status-}<span>已付款</span>{-else-}
				<a href="?status=paid">已付款</a>{-/if-}
				{-if 'shipping'==$rP.status-}<span>已发货</span>{-else-}
				<a href="?status=shipping">已发货</a>{-/if-}
				{-if 'closed'==$rP.status-}<span>已关闭</span>{-else-}
				<a href="?status=closed">已关闭</a>{-/if-}
				{-if 'hided'==$rP.status-}<span>已隐藏</span>{-else-}
				<a href="?status=hided">已隐藏</a>{-/if-}
			</td>
			<td colspan="4" align="right">翻页条：
{-html_pager max=$rPager.Max page=$rPager.Num
	link="<a href=\"?status=`$smarty.get.status`&`$rPager.Req`={X}\">{X}</a>"
	text="<span>{X}</span>"
	range=5
-} | 每页{-$rPager.Sze-}条
			</td>
		</tr>
		<tr class="capt">
			<td>订单号</td>
			<td>下单时间</td>
			<td>下单用户</td>
			<td>付款时间</td>
			<td>金额</td>
			<td>货币</td>
			<td>支付方式</td>
			<td>收货地址</td>
			<td>收货人姓名</td>
			<td>订单状态</td>
			<td>&nbsp;</td>
		</tr>
{-section name=i loop=$rList-}
		<tr>
			<td>{-$rList[i].id|escape:html-}</td>
			<td>{-$rList[i].time_added|substr:5:11-}</td>
			<td>{-$rList[i].owner_nick|escape:html-}</td>
			<td>{-$rList[i].time_paid|substr:5:11-}</td>
			<td align="right">{-$rList[i].total_price|ceil-}</td>
			<td>{-if 'dollor'==$rList[i].payment_money-}USD{-else-}RMB{-/if-}</td>
			<td>{-$rList[i].payment_method|escape:html-}</td>
			<td><span title="{-$rList[i].ship_address|escape:html-}">{-$rList[i].ship_address|td_truncate:32|escape:html-}</span></td>
			<td><span title="{-$rList[i].ship_sign|escape:html-}">{-$rList[i].ship_sign|td_truncate:12|escape:html-}</span></td>
			<td>{-$rList[i].status|escape:html-}</td>
			<td><a href="?action=edit&id={-$rList[i].id-}">详情</a></td>
		</tr>
{-/section-}
		<tr class="capt">
			<td>订单号</td>
			<td>下单时间</td>
			<td>下单用户</td>
			<td>付款时间</td>
			<td>金额</td>
			<td>货币</td>
			<td>支付方式</td>
			<td>收货地址</td>
			<td>收货人姓名</td>
			<td>订单状态</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="11" align="right">翻页条：
{-html_pager max=$rPager.Max page=$rPager.Num
	link="<a href=\"?status=`$smarty.get.status`&`$rPager.Req`={X}\">{X}</a>"
	text="<span>{X}</span>"
	range=5
-} | 每页{-$rPager.Sze-}条
			</td>
		</tr>
	</table>
</div>
{- elseif 'edit'==$sAction -}
<div class="sL edit list">
	<p>订单详情</p>
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td class="indc">订单ID：</td><td>{-$rOne.id-}</td>
			<td class="indc">总金额：</td><td><font color="red">{-$rOne.total_price-} {-if 'dollor'==$rOne.payment_money-}USD{-else-}RMB{-/if-}</font></td>
			<td class="indc">订单状态：</td><td>{-$rOne.status-}</td>
		</tr>
		<tr>
			<td class="indc">下单用户：</td><td>{-$rOne.owner_nick|escape:html-}</td>
			<td class="indc">付款方式：</td><td>{-$rOne.payment_method|escape:html-}</td>
			<td class="indc">下单时间：</td><td>{-$rOne.time_added|substr:5:11-}</td>
		</tr>
		<tr>
			<td class="indc">运费：</td><td>{-$rOne.ship_price|escape:html-}</td>
			<td class="indc">快递公司：</td><td>{-$rOne.ship_method|escape:html-}</td>
			<td class="indc">收货地址：</td><td>{-$rOne.ship_address|escape:html-} {-$rOne.ship_postcode|escape:html-}</td>
		</tr>
		<tr>
			<td class="indc">收货人：</td><td>{-$rOne.ship_sign|escape:html-}</td>
			<td class="indc">手机：</td><td>{-$rOne.ship_mobile|escape:html-}</td>
			<td class="indc">联系方式：</td><td>{-$rOne.ship_phone|escape:html-} {-$rOne.ship_email|escape:html-}</td>
		</tr>
	</table>
	<p>更改历史</p>
	<table border="0" cellspacing="0" cellpadding="0">
		<tr class="capt">
			<td>时间</td><td>动作</td><td>详细</td>
		</tr>
{-section name=i loop=$rChangelog-}
		<tr>
			<td>{-$rChangelog[i].time_changed-}</td>
			<td>{-$rChangelog[i].action-}</td>
			<td>{-$rChangelog[i].param|unserialize|@data2show|nl2br-}</td>
		</tr>
{-/section-}
	</table>
	<p>商品信息</p>
	<table border="0" cellspacing="0" cellpadding="5">
{-section name=i loop=$rWorks-}
	<tr>
		<td><a href="/artwork/detail.php?id={-$rWorks[i].id-}" target="_blank"><img src="{-$rWorks[i].thumb|uWork_thumb:$rWorks[i].id:'50x50.jpg'-}" /></a></td>
		<td><a href="/artwork/detail.php?id={-$rWorks[i].id-}" target="_blank">{-$rWorks[i].title|escape:html-}</a></td>
		<td class="indc">尺寸：</td><td>{-$rWorks[i]|@uWork_i18n:size_title|escape:html-}</td>
		<td class="indc">边框：</td><td>{-if $rWorks[i].kuang_id-}有{-else-}<i>无</i>{-/if-}</td>
		<td class="indc">数量：</td><td>{-$rWorks[i].quantity-}</td>
	</tr>
{-/section-}
	</table>
{-if 'prepaid'==$rOne.status || 'paid'==$rOne.status-}
	<p>状态修改为已发货</p>
	<form method="post">
	<input type="hidden" name="id" value="{-$rOne.id-}" />
	<table border="0" cellspacing="0" cellpadding="5">
		<tr>
			<td>快递公司：</td><td>{-$rOne.ship_method|escape:html-}</td>
		</tr>
		<tr>
			<td>快递单号：</td><td>
				<input type="text" name="ship_sn" value="{-$rOne.ship_sn|escape:html-}" />
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="checkbox" name="status" value="shipping" /> 确认已发货
				<input type="submit" name="action" value="update" />
			</td>
		</tr>
	</table>
	</form>
{-/if-}
	<br /><br />&nbsp; &nbsp;
	<a href="?">返回列表</a>
</div>
{- else -}
sth wrong: no $sAction.
{- /if -}

<!-- </main> -->
	</div>
</div>

{- include file="`$__PHY_WEB``$__DIR_ADM`/block/footer.tpl" -}

</div><!-- end all -->
</body>
</html>
